package com.zs.proxy;


import net.sf.cglib.proxy.Enhancer;

/**
 * @author ZhouShuang
 * @version 17
 * @Title
 * @date 2025/6/10 下午11:04
 */
public class IntermediaryCglibProxyFactory2 {
    private static final IntermediaryMethodInterceptor2 interceptor = new IntermediaryMethodInterceptor2();

    public static <T> T create(Class<T> target){
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(target);
        enhancer.setCallback(interceptor);
        return (T) enhancer.create();
    }
}
